package com.ziki.bswicket.component;

import org.apache.wicket.model.IModel;

import com.ziki.bswicket.action.SubmitAction;
import com.ziki.framework.wicket.markup.html.form.FwForm;

public class BsForm<T> extends FwForm<T> {
    private static final long serialVersionUID = 1L;
    private SubmitAction action;

    public BsForm(String id, IModel<T> model) {
        super(id, model);
    }

    public BsForm(String id) {
        super(id);
    }

    public void add(SubmitAction action) {
        this.action = action;
    }

    @Override
    protected void onSubmit() {
        if (this.action != null) {
            this.action.performSubmit();
        }
    }
}
